#!usr/bin/perl -w

use strict;

die "usage:perl $0 <all_orthomcl.out> \n" unless @ARGV == 1;

open A,$ARGV[0];
my %tar;
while(<A>){
	chomp;my @a=split /\s+/; my %part;
	foreach my $k(3..$#a){
		my @c=split /[()]/,$a[$k];	$part{$c[1]}++;
	}

	foreach my $k1(sort keys %part){
		my $int=int($part{$k1}/10);
		$tar{$k1}{$int}++;
	}
}
close A;
foreach my $k1(sort keys %tar){
	foreach my $k2(sort {$a<=>$b} keys %{$tar{$k1}}){
		my $start=$k2*10;	my $end=$start+9;
		print "$k1\t$start-$end\t$tar{$k1}{$k2}\n";
	}
}
